/*
 * testToString.cpp
 *
 *  Created on: 2011-10-6
 *      Author: 胡剑青
 */

#include "util.h"

#include <iostream>
#include <cstdio>
using namespace std;
using namespace zach;

int main()
{
	try {
		//初始化
		util::UTF8Reader reader;
		reader.init( "test\\utf8.txt" );

		//接收字符串
		vector<Char> vc;

		//循环读入
		while ( !reader.isEnd() ) {
			reader.readChar();
			vc.push_back( reader.lastRead() );
		}

		//转换
		Char* str = new Char[vc.size()];for
(		int i=0; i<vc.size(); i++)
		{
			str[i] = vc[i];
		}
		string s = toString( str, vc.size() );
		cout << s << "<endl>" << endl;
	}
	catch ( zach::Error& e ) {
		printf( "Error: %s\n", e.message().c_str() );
	}

	return 0;
}
